import os
from openai import OpenAI
from pyexpat.errors import messages

api_key = 'sk-7b4cb6aa21fa442f90bbe851265dd008'
base_url = 'https://api.deepseek.com/'

client = OpenAI(
    api_key=api_key,
    base_url=base_url,
    timeout=120
)

messages = [{'role':"user","content":"介绍一下自己"}]

response = client.chat.completions.create(model="deepseek-chat",messages=messages)

print(response.choices[0].message.content)